Towards Effectively Eliminating Conditional Rewrite Rules
نویسنده
چکیده
Conditional rewrite rules are notorious for being difficult to implement in rewrite engines. This is because, like in the case of function calls in programming language implementations, rewrite engines need to ”freeze” the current rewriting environment and to create a new one in which the condition is reduced. Stacking these rewriting environments efficiently can easily become a nontrivial task, which can have a direct impact on the efficiency of rewriting. Continuation-passing-style (CPS) transformations are used as a front-end in many programming languages to transform the programs to compile into a convenient and highly optimizable form, in which functions never need to return their values: they just pass their computed values to the current data-context, which ”knows” how to continue the computation. We argue that a similar transformation technique can be applied to conditional rewrite systems, to transform them into computationally equivalent unconditional rewrite systems. In this paper we present the first steps towards such a transformation. No special support is needed from the underlying unconditional rewrite engine, so the presented technique can be used as a front-end to any of the current rewrite engines. Since unconditional rewriting is more amenable to parallelization, our transformation is expected to lead to efficient concurrent implementations of rewriting.
منابع مشابه
Towards a Datatype Defining Rewrite System for Rational Arithmetic
In [3] the concept of datatype defining rewrite systems (DDRSs) is introduced. A DDRS is an equational specification of a datatype that yields a ground-complete term rewriting system (TRS) when its equations are interpreted from left to right as rewrite rules. In [3] a number of DDRSs are presented for terms in unary, binary, and decimal notation. The goal of the present work is to review wheth...
متن کاملConditional Rewrite Rules: Confluence and Termination
Algebraic specifications of abstract data types can often be viewed as systems of rewrite rules. Here we consider rewrite rules with conditions, such as they arise, e.g., from algebraic specifications with positive conditional equations. The conditional term rewriting systems thus obtained which we will study, are based upon the well-known class of left-linear, nonambiguous TRSs. A large part o...
متن کاملLevel-Con uence of Conditional Rewrite Systems with Extra Variables in Right-Hand Sides
Level-con uence is an important property of conditional term rewriting systems that allow extra variables in the rewrite rules because it guarantees the completeness of narrowing for such systems. In this paper we present a syntactic condition ensuring level-con uence for orthogonal, not necessarily terminating, conditional term rewriting systems that have extra variables in the right-hand side...
متن کاملFrom Conditional to Unconditional Rewriting
An automated technique to translate conditional rewrite rules into unconditional ones is presented, which is suitable to implement, or compile, conditional rewriting on top of much simpler and easier to optimize unconditional rewrite systems. An experiment performed on world’s fastest conditional rewriting engines shows that speedups for conditional rewriting of an order of magnitude can alread...
متن کاملLevel-Confluence of Conditional Rewrite Systems with Extra Variables in Right-Hand Sides
Level-confluence is an important property of conditional term rewriting systems that allow extra variables in the rewrite rules because it guarantees the completeness of narrowing for such systems. In this paper we present a syntactic condition ensuring level-confluence for orthogonal, not necessarily terminating, conditional term rewriting systems that have extra variables in the right-hand si...
متن کامل